import javax.swing.*;
import java.awt.*;

public class GameFrame extends JFrame {
    //定义窗口大小
    final int frameSize = 2000;
    public void launch(){
        //标题
        this.setTitle("贪吃蛇");
        //窗口大小
        this.setSize(frameSize,frameSize);
        //窗口相对位置
        this.setLocationRelativeTo(null);
        //窗口可见性
        this.setVisible(true);
        //关闭窗口操作JFrame.EXIT_ON_CLOSE关闭窗口，程序退出
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
    public void paint(Graphics graphics){
        graphics.setColor(Color.CYAN);
        graphics.fillRect(0,0,frameSize,frameSize);
    }

    public static void main(String[] args) {
        GameFrame gameFrame = new GameFrame();
        gameFrame.launch();
    }
}
